#include <zenoui/widgets/ButtonWidget.hpp>
#include <zenoui/check_gl.hpp>
#include <zenox/glm.hpp>

namespace zenoui {

void ButtonWidget::handle(MouseClickEvent *event) {
    m_pressed = true;
    event->accept(this);
}

void ButtonWidget::handle(MouseReleaseEvent *event) {
    m_pressed = false;
    event->accept(this);
}

void ButtonWidget::paint() {
    m_button_rect_draw.paint(rect(), m_background_color, m_pressed);
    LabelWidget::label_paint();
}

ButtonWidget::ButtonWidget() {
    m_background_color = {0.48f, 0.49f, 0.5f, 1.0f};
}

}
